package ai.plantdata.Behavior.mode.StatePattern.test;

import ai.plantdata.Behavior.mode.StatePattern.classes.Context;
import ai.plantdata.Behavior.mode.StatePattern.interefaces.impl.StartState;
import ai.plantdata.Behavior.mode.StatePattern.interefaces.impl.StopState;

/**
 * @Author: WangHui
 * @Date: 2020/12/23 16:21
 * @Description:
 */
public class StatePatternDemo {
    public static void main(String[] args) {
        Context context = new Context();

        StartState startState = new StartState();
        startState.doAction(context);

        System.out.println(context.getState().toString());

        StopState stopState = new StopState();
        stopState.doAction(context);
        System.out.println(context.getState().toString());
    }
}
